<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/_linkPages/basePath.jsp" %>
<!DOCTYPE html>
<%--我的帖子--%>
<!-- saved from url=(0052)http://www.maomijiaoyi.com/index.php?/wodetiezi.html -->
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>猫咪交易网,我的信息-我的帖子</title>
    <meta name="keywords" content="宠物猫,买猫,卖猫,宠物猫交易,宠物猫价格">
    <meta name="description"
          content="猫咪交易网(www.maomijiaoyi.com)行业购宠第一品牌，千万家卖猫商家入驻覆盖全国各地，买放心宠物猫、了解最全面的宠物猫价格就上猫咪交易网、12年品牌值得信赖！">

    <link rel="stylesheet" href="${basePath}jsp/hs/css/usercenter.css">
    <link rel="stylesheet" href="${basePath}jsp/hs/css/comment.css">
    <link rel="stylesheet" href="${basePath}jsp/hs/css/bootstrap.min.css">
    <script src="${basePath}jsp/hs/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="${basePath}jsp/hs/js/bootstrap.min.js"></script>
    <script src="${basePath}jsp/hs/js/custom.js"></script>
    <script src="${basePath}jsp/hs/js/comment.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>

<!-- 引入公共头部 -->
<!-- 网页头部 -->
<%@ include file="cat/head.jsp"%>

<div style="height: 80px;"></div>

<!-- 面包屑导航栏 Crumbs_nav-->
<div id="Crumbs_nav">
    <a target="_blank" href="http://localhost:8080/jsp/hs/index.jsp">首页 &gt;</a>

    <a href="http://localhost:8080/jsp/hs/myPost.jsp"><span>我的帖子</span></a>
</div>


<!-- 个人中心 user_box-->
<div id="user_box" style="border: #eee solid 3px; box-sizing: border-box; height: 960px;">

    <!-- 左侧侧边栏 -->
    <div id="left_side" style="height: 960px;">

        <a href="http://localhost:8080/jsp/hs/personal.jsp">
            <img src="${basePath}jsp/hs/img/userinfo.png" alt="">
            <p>个人信息</p>
        </a>

        <a href="http://localhost:8080/jsp/hs/modify.jsp">
            <img src="${basePath}jsp/hs/img/xiugai_zl.png" alt="">
            <p>修改资料</p>
        </a>

        <a href="http://localhost:8080/jsp/hs/password.jsp">
            <img src="${basePath}jsp/hs/img/xiugai_pwd.png" alt="">
            <p>修改密码</p>
        </a>

        <a href="${basePath}head?method=tomypostPage&username=${user.username}"
           style="background: rgba(56,50,50,0.2);position: relative;" id="my_post">
            <img src="${basePath}jsp/hs/img/my_post.png" alt="">
            <p>我的帖子</p>
        </a>

        <div id="mypost_opt">

            <a href="${basePath}head?method=examination&username=${user.username}">审核中的帖子</a>

        </div>


    </div>

    <script>

        var mypost_opt_sta = 1;

        $("#left_side #my_post").mouseenter(function () {

            if (mypost_opt_sta == 1) {

                $("#left_side #mypost_opt").stop().animate({'height': '160px'}, 300);

                mypost_opt_sta = 2;
            } else {

                $("#left_side #mypost_opt").stop().animate({'height': '0px'}, 300);

                mypost_opt_sta = 1;
            }

        })

    </script>


    <!-- 右侧信息展示 -->
    <div id="right_infobox">

        <p class="base_info">

            我的帖子
        </p>

        <c:if test=" ${empty mycatpost}">

        <!-- 没有帖子 -->
        <div id="no_post">您还没有发表帖子，快去发帖子吧！<a href="http://www.maomijiaoyi.com/index.php?/home/ReleasePost">免费发布信息</a>
        </div>
        </c:if>

        <c:if test="${not empty mycatpost}">


        <!-- 帖子列表 -->
        <div id="post_list">

            <c:forEach items="${mycatpost}" var="catpost">
            <li>
                <!-- 帖子操作 post_operation-->
                <div class="post_operation">

                    <div class="operation_button"></div>

                    <div class="operation_opt">

                        <!-- 编辑帖子 -->
<%--                        <a href="${basePath}head?method=toinformation2&postid=${catpost.id}" class="edit_box" title="编辑"></a>--%>

                        <!-- 删除帖子 -->
                        <a href="javascript:del(${catpost.id})" class="del_post" title="删除"></a>

                    </div>

                </div>

                <!-- 图片 -->
                <a  class="post_img" href="${basePath}catlogin?method=indexSell&id=${catpost.id}"><img src="${basePath}varieties?method=showPic&pic=${catpost.pic1}" alt=""></a>

                <!-- 标题 -->
                <a  class="post_title">${catpost.posttitle}</a>

                <p class="breeds_name">品种：${catpost.catbreed}</p>

                <p class="price">价格：${catpost.catpice} <span>待售数量：${catpost.dsnum} </span></p>

            </li>

            </c:forEach>
        </div>

        </c:if>
        <script>

            $("#user_box #right_infobox #post_list li .post_operation ").click(function () {
                $("#user_box #right_infobox #post_list li .post_operation .operation_opt").stop().animate({'left': '84px'}, 300);
                $(this).find(".operation_opt").stop().animate({'left': '0px'}, 300);
            })

        </script>

        <style type="text/css">
            .pagelink {
                cursor: pointer;
            }

            .pagelink:hover {
                background: #fd871d !important;
                color: #FFF !important;
            }
        </style>

        <!-- 分页位置 paging_box-->
        <div id="paging_box">

            <div id="center_box" style="width: 500px">
                <c:if var="isFirst" test="${postpm.pn <= 1}">
                    <li class="prev disabled">
                        <a href="javascript:;">首页</a>
                    </li>
                </c:if>
                <c:if test="${!isFirst}">
                <li class="prev disabled">
                    <a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=1">首页</a>
                </li>
                </c:if>
                <c:if test="${!isFirst}">
                    <li class="prev">
                        <a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=${postpm.pn-1}">
                            上一页
                        </a>
                    </li>
                </c:if>
                <c:if var="er" test="${postpm.pn eq '1'}">
                    <c:forEach var="i" begin="${postpm.pn < 1 ? 1:postpm.pn}" end="${postpm.pn+2}" step="1">
                        <c:if var="isPn" test="${postpm.pn==i}">
                            <li class="active"><a href="javascript:;">${i}</a></li>
                        </c:if>
                        <c:if test="${!isPn}">
                            <li><a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=${i}">${i}</a></li>
                        </c:if>
                    </c:forEach>
                </c:if>
                <c:if test="${!er}">
                    <c:forEach var="i" begin="${postpm.pn < 1 ? 1:postpm.pn}" end="${  postpm.pn+2 > postpm.pages?postpm.pages:postpm.pn+2}" step="1">
                        <c:if var="isPn" test="${postpm.pn==i}">
                            <li class="active"><a href="javascript:;">${i}</a></li>
                        </c:if>
                        <c:if test="${!isPn}">
                            <li><a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=${i}">${i}</a></li>
                        </c:if>
                    </c:forEach>
                </c:if>
                <c:if var="isLast" test="${postpm.pn >= postpm.pages}">
                    <li class="next disabled">
                        <a href="javascript:;">尾页</a>
                    </li>
                </c:if>
                <c:if test="${!isLast}">
                    <li class="next">
                        <a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=${postpm.pn+1}">
                            下一页
                        </a>
                    </li>
                </c:if>
                <c:if test="${!isLast}">
                    <li class="next disabled">
                        <a href="${basePath}head?method=tomypostPage&username=${user.username}&pn=${postpm.pages}">尾页</a>
                    </li>
                </c:if>

<%--                <a href="javascript:void(0);"><img src="${basePath}jsp/hs/img/paging_left.png" alt=""></a>--%>
<%--                <a class="pagelink" style="background:#fd871d;color:#fff;"--%>
<%--                   href="http://www.maomijiaoyi.com/index.php?/home/UserPostLists/all/1--5">1</a><a--%>
<%--                    style="color:#333333;">2</a><a style="color:#333333;">3</a><a style="color:#333333;">4</a><a--%>
<%--                    style="color:#333333;">5</a><a style="color:#333333;">6</a> <a href="javascript:void(0);"><img--%>
<%--                    src="${basePath}jsp/hs/img/paging_right.png" alt=""></a>--%>

            </div>
                 <P align="center">当前是第${postpm.pn}页 一共有${postpm.pages}页</P>
        </div>

    </div>

</div>


<div style="height: 80px;"></div>

<!-- 引入公共尾部 -->
<!-- 网页底部 -->
<div id="footer">

    <div class="logo">
        <div class="logo_kuang">
            <div>
                <a href="http://localhost:8080/jsp/hs/index.jsp">
                    <img alt="猫咪交易网" title="猫咪交易网" src="${basePath}jsp/hs/img/logo.png">
                </a>
            </div>
        </div>
    </div>


    <div class="banquan">
        <div class="center_1220">
            版权所有：猫咪交易网 www.maomijiaoyi.com 友情链接互换:qq 3416807849
        </div>
    </div>

    <div class="banquan">
        <div class="center_1220">
            【免责声明：本站所有猫猫交易信息内容系用户自行发布，其真实性、合法性由发布人负责，本站不提供任何保证，亦不承担任何法律责任！】
        </div>
    </div>

    <div class="banquan">
        <div class="center_1220">
            <a style="color: #FFF;" href="http://www.beian.gov.cn/portal/registerSystemInfo" target="_blank">
                <img src="${basePath}jsp/hs/img/foot_link3.png">
                沪ICP备18022709号-1 </a>
        </div>
    </div>
</div>

<script>
    function del(id) {
        //$("#bootbox-options-del")
        //var obj = document.getElementById("bootbox-options-del");
        //console.log(obj);

        if (window.confirm("确定要删除吗!!!")){

            window.location.href ="${basePath}head?method=deletePost&pn=${postpm.pn}&id="+id;
        }


    }

    function Toast(msg,duration){
        duration=isNaN(duration)?3000:duration;
        var m = document.createElement('div');
        m.innerHTML = msg;
        m.style.cssText="width:50%; min-width:150px; background:#000; opacity:0.5; height:40px; color:#fff; line-height:40px; text-align:center; border-radius:5px; position:fixed; top:40%; left:20%; z-index:999999; font-weight:bold;";
        document.body.appendChild(m);
        setTimeout(function() {
            var d = 0.5;
            m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
            m.style.opacity = '0';
            setTimeout(function() { document.body.removeChild(m) }, d * 1000);
        }, duration);
    }
    $(function() {

            console.log("${booleans}");
            console.log("${msg}");
            if ("${booleans}" == "true"){
                console.log(1)
                Toast('${msg}',2000);
            }
            //Toast('${msg}',2000);
        }

        <c:remove var="msg" scope="session"/>
        <c:remove var="booleans" scope="session"/>

    )

</script>
</body>
</html>